//"uniform mat4 viewMatrix;",
//"uniform vec3 cameraPosition;",

uniform vec3 colorBase;
uniform vec3 colorDiffuse;
uniform vec3 colorSpec;

varying vec4 viewPosition;
varying vec3 viewNormal;

void main() {
    vec3 viewDir = normalize(vec3(0.0, 0.0, 0.0) - vec3(viewPosition));

    // pow(max(dot(viewDir, reflectDir), 0.0), 32)

    float dotValue = max(1.0 - dot(viewDir, viewNormal), 0.0);

    vec3 diffuseColor = colorDiffuse * dotValue;
    float stepValue = step( 0.1, dotValue);
    vec3 specColor = colorSpec * pow(dotValue, 4.0) * stepValue;
    vec3 calcColor = colorBase + diffuseColor + specColor;

    vec4 vColor = vec4(calcColor, 1.0);

    gl_FragColor = vColor;
}